<template>
  <view class="order-confirm" v-cloak>
    <view class="detail-order">
      <view class="order-card">
        <view class="order-item">
          <view class="item-label">预约门店</view>
          <view class="item-info">民院路门诊</view>
        </view>
        <view class="order-item">
          <view class="item-label">预约项目</view>
          <view class="item-info">进口皓齿冷光美白</view>
        </view>
      </view>
      <view class="main-card">
        <view class="main-title">到店时间 <image src="@/static/date-icon.png" class="date-icon" mode="aspectFill"></image></view>
        <view class="main-tabs not-bar">
          <view class="tabs-item active">
            <view class="item-h2">今天</view>
            <view>10-22</view>
          </view>
          <view class="tabs-item">
            <view class="item-h2">周一</view>
            <view>10-23</view>
          </view>
        </view>
        <view class="main-time">
          <view class="time-item active">08:00-10:00</view>
          <view class="time-item">10:00-12:00</view>
          <view class="time-item">14:00-16:00</view>
          <view class="time-item">16:00-18:00</view>
        </view>
      </view>
      <view class="main-card">
        <view class="buy-num">
          <view class="h2">购买数量</view>
          <view class="inputNumber">
            <image src="@/static/gray.jpg" mode="aspectFill" class="img"></image>
            <view style="margin:0 20rpx">1</view>
            <image src="@/static/gray.jpg" mode="aspectFill" class="img"></image>
          </view>
        </view>
        <view class="main-title">预约医生</view>
        <view class="main-doctor">
          <view class="doctor-item" v-for="(item,idx) in 3" :key="idx">
            <image src="@/static/gray.jpg" mode="aspectFill" class="img"></image>
            <image src="@/static/check-on.png" v-show="idx== 0" mode="aspectFill" class="icon"></image>
            <view class="h2">冯海军</view>
          </view>
          <view class="doctor-item active">
            <image src="@/static/doctor-default.png" mode="aspectFill" class="img"></image>
            <view class="h2">到店分配</view>
          </view>
        </view>
      </view>
      <view class="order-card">
        <view class="order-item">
          <view class="item-label">
            <view>意向门店</view>
            <view class="sub">总积分304</view>
          </view>
          <view class="item-info">
            <view class="price">-¥0</view>
            <view class="sub">本单可用300积分</view>
          </view>
          <radio style="margin-left: 10rpx;" value="" />
        </view>
        <view class="order-item">
          <view class="item-label">优惠券</view>
          <view class="item-info box-flex" @click="$refs.couponPopup.open()">
            <view class="coupon" v-if="true">1张可用</view>
            <view class="coupon-none" v-else>无可用</view>
            <uni-icons type="right" color="#b0b0b0" size="14"></uni-icons>
          </view>
        </view>
        <view class="order-item">
          <view class="item-label">备注</view>
          <input placeholder="请填写偏好备注" class="input" />
        </view>
      </view>
      <uni-popup ref="couponPopup" type="bottom">
        <view class="coupon-popup">
          <view class="popup-header">
            <uni-icons type="closeempty" size="20" color="#B0B0B0" @click="$refs.couponPopup.close()"></uni-icons>
            <h2>选择牙荷优惠券</h2>
            <view></view>
          </view>
          <view class="popup-main not-bar">
            <view class="main-item" v-for="(item,idx) in 3" :key="idx">
              <view class="item-price">
                <view class="strong">99</view> 元
              </view>
              <view class="item-info">
                <view class="h2">洗牙券 <span class="span">无门槛券</span></view>
                <view class="p">2024-10-10到期</view>
                <view class="span">仅限每荷诊所使用</view>
              </view>
              <radio style="margin-left: 10rpx;" value="" />
            </view>
          </view>
          <view class="popup-footer">
            <view class="button">确认</view>
          </view>
        </view>
      </uni-popup>
<!--     <view class="order-notice order-card">
        <view class="title">购买须知</view>
        <view class="notice-item"><image src="@/static/circle-gray.png" mode="aspectFill"></image> <view class="item-p">有效时间：购买后90天内有效</view></view>
        <view class="notice-item"><image src="@/static/circle-gray.png" mode="aspectFill"></image> <view class="item-p">除外日期：2024-02-09至2024-02-12不可用</view></view>
      </view> -->
    </view>
    <view class="popup-order-footer">
      <view class="footer-info">合计¥19.9 <span class="theme-color">优惠¥19.9</span></view>
      <view class="footer-button" @click="handlePay()">立即支付 <span style="margin: 0 4rpx;font-size: 24rpx">¥</span> <span class="strong">19.9</span></view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        
      };
    },
    methods:{
      handlePay(){  // 点击支付
        uni.navigateTo({
          url:'/pages/other/pay-result'
        })
      },
    }
  }
</script>

<style lang="less" scoped>
.order-confirm{
  padding-bottom: 140rpx;
  .detail-order{
    border-radius: 20rpx 20rpx 0 0;
    background: var(--page-bg);
    padding: 24rpx;
    
    .order-card{
      padding: 0 24rpx;
      border-radius: 20rpx;
      background: #fff;
      margin-bottom: 20rpx;
    }
    .main-card{
      padding: 28rpx 24rpx;
      background: #fff;
      border-radius: 20rpx;
      margin-bottom: 20rpx;
      .buy-num{
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20rpx;
        .h2{
          font-size: 30rpx;
          color: var(--title-color);
        }
        .inputNumber{
          display: flex;
          align-items: center;
          .img{
            width: 44rpx;
            height: 44rpx;
          }
        }
      }
    }
    .main-title{
      font-size: 28rpx;
      margin-bottom: 6rpx;
      color: var(--title-color);
      display: flex;
      align-items: center;
      .date-icon{
        width: 32rpx;
        height: 32rpx;
        margin-left: auto;
      }
    }
    .main-doctor{
      display: flex;
      align-items: center;
      .doctor-item{
        margin-right: 20rpx;
        width: 114rpx;
        border-radius: 8rpx;
        overflow: hidden;
        border: 2rpx solid transparent;
        position: relative;
        &.active{
          border-color: var(--theme-color);
        }
        .img{
          width: 114rpx;
          height: 114rpx;
          display: block
        }
        .icon{
          position: absolute;
          right: 0;
          top: 0;
          width: 30rpx;
          height: 30rpx;
        }
        .h2{
          font-size: 22rpx;
          color: var(--title-color);
          line-height: 38rpx;
          text-align: center;
        }
      }
    }
    .main-tabs{
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      margin: 18rpx 0 6rpx;
      .tabs-item{
        width: 90rpx;
        border-bottom: 4rpx solid transparent;
        margin-right: 10rpx;
        padding-bottom: 8rpx;
        color: #B0B0B0;
        white-space: nowrap;
        text-align: center;
        font-size: 22rpx;
        .item-h2{
          color: #6D6D6D;
          font-size: 26rpx;
          font-weight: bold;
        }
        &.active{
          border-bottom: 4rpx solid var(--theme-color);
          color: var(--theme-color);
          .item-h2{
            color: var(--theme-color);
          }
        }
      }
    }
    .main-time{
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      .time-item{
        width: 49%;
        line-height: 60rpx;
        border-radius: 60rpx;
        text-align: center;
        background: var(--page-bg);
        margin-top: 18rpx;
        font-size: 24rpx;
        color: #6D6D6D;
        &.active{
          background: var(--theme-color);
          color: #fff;
        }
      }
    }
    .order-item{
      padding: 28rpx 0;
      display: flex;
      align-items: center;
      font-size: 28rpx;
      .item-label{
        color: var(--title-color);
        margin-right: auto;
      }
      .item-info{
        color: #6D6D6D;
        text-align: right;
      }
      .price{
        color: var(--sub-theme);
      }
      .sub{
        font-size: 22rpx;
        color: var(--sub-title);
      }
      .coupon{
        line-height: 1;
        background: var(--sub-theme-10);
        color: var(--sub-theme);
        border: 2rpx solid var(--sub-theme);
        font-size: 20rpx;
        padding: 8rpx;
        border-radius: 4rpx;
      }
      .coupon-none{
        color: var(--sub-title);
      }
      .input{
        text-align: right;
        font-size: 28rpx;
        color: #6D6D6D;
        flex: 1;
      }
    }
    .order-notice{
      padding: 28rpx 24rpx;
      .title{
        font-size: 28rpx;
        font-weight: bold;
        color: var(--title-color);
      }
      .notice-item{
        margin-top: 20rpx;
        font-size: 24rpx;
        color: #6D6D6D;
        display: flex;
        align-items: center;
        image{
          width: 26rpx;
          height: 26rpx;
        }
        .item-p{
          margin-left: 4rpx;
        }
      }
    }
    
  }  //  detail-order end
  .popup-order-footer{
    background: #fff;
    box-shadow: 0rpx -10rpx 19rpx 0rpx rgba(0,0,0,0.06);
    padding: 16rpx 24rpx;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    .footer-info{
      font-size: 24rpx;
      color: var(--title-color);
      .theme-color{
        margin-left: 16rpx;
      }
    }
    .footer-button{
      line-height: 80rpx;
      background: linear-gradient( 90deg, #29D8C6 0%, #10BEAF 100%);
      color: #fff;
      margin-top: 16rpx;
      text-align: center;
      font-size: 28rpx;
      border-radius: 80rpx;
      .strong{
        font-weight: bold;
        font-size: 32rpx;
      }
    }
  }
  
  .coupon-popup{
    border-radius: 20rpx 20rpx 0 0;
    padding: 24rpx;
    background: #fff;
    .popup-header{
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24rpx;
      h2{
        font-size: 28rpx;
        color: var(--title-color);
      }
    }
    .popup-main{
      .main-item{
        display: flex;
        align-items: center;
        background: var(--sub-theme-10);
        border-radius: 20rpx;
        margin: 20rpx 0;
        padding-right: 20rpx;
        .item-price{
          width: 164rpx;
          display: flex;
          align-items: flex-end;
          justify-content: center;
          color: var(--sub-theme);
          font-size: 20rpx;
          .strong{
            font-size: 60rpx;
            font-weight: bold;
          }
        }
      }
      .item-info{
        flex: 1;
        border-left: 2rpx dashed rgba(0,0,0,0.12);
        padding: 32rpx 28rpx;
        margin-right: auto;
        .h2{
          font-size: 26rpx;
          font-weight: bold;
          color: var(--title-color);
          .span{
            line-height: 1;
            font-size: 18rpx;
            color: var(--sub-theme);
            background: var(--sub-theme-10);
            padding: 2rpx 6rpx;
            border-radius: 4rpx;
            margin-left: 8rpx;
          }
        }
        .p{
          color: var(--sub-theme);
          font-size: 22rpx;
          margin: 10rpx 0;
        }
        .span{
          color: var(--sub-title);
          font-size: 20rpx;
        }
      }
    }  //  popup-main end
    .popup-footer{
      margin-top: 24rpx;
      padding: 14rpx 0;
      .button{
        line-height: 72rpx;
        font-size: 28rpx;
        background: linear-gradient( 90deg, #29D8C6 0%, #10BEAF 100%);
        text-align: center;
        border-radius: 72rpx;
        color: #fff;
      }
    }
  }  // coupon-popup end
} ///  order-confirm end
</style>
